<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <myh></myh>
        <myf></myf>
    </div>
    <template id="ft">
        <footer>
            <a href="#">百度</a>
            {{footmsg}}
        </footer>
    </template>
</body>
<script src="js/vue.js"></script>
<script>
    let vm = new Vue({
        el: "#app",
        // 局部组件 作用域:只在当实例中有效
        components: {
            myh: {
                template: '<h1>头部</h1>'
            },
            myf: {
                template: '#ft',
                data() {
                    return {
                        footmsg: "底部数据"
                    }
                }
            }
        }
    })
</script>

</html>